using System;
using System.Collections.Generic;
using System.Text;

namespace Mud.EmlenMudMain
{
  [FlagsAttribute]
  public enum ModuleResponse
  {
    NoResponse = 0,
    AllowOrSuccess = 1,					// successful execution of the module's action
    DenyOrFail = 1 << 1,					// Denial of execution of the module's action
    ContainsOutputMessage = 1 << 2,	// contains a string output message
    CatastrophicFailure = 1 << 3,		// do not continue and deny other modules from executing
    HookHandledDoNotBubble = 1 << 4,	// continue, but deny other modules from executing
    ContinueEvenIfPriorFailure = 1 << 5
  }

  public enum ActionTypes
  {
    Initialization = 0,
    LoadDataAtBootup = 1,
    SaveData = 2,
    MudShuttingDown = 3,
    /// <summary>
    /// Happens every so often
    /// </summary>
    MudTick = 5,

    /// <summary>
    /// A user command just came in
    /// </summary>
    UserCommandReceived = 20,
    /// <summary>
    /// Occurs when the command is not recognized, but 
    /// before checking socials
    /// </summary>
    UserCommandUnrecognizedBeforeSocialCheck = 21,
    /// <summary>
    /// Occurs when all other modules and the Mud
    /// could not make sense of the user's command
    /// </summary>
    UserCommandUnrecognized = 22,

    /// <summary>
    /// Beginning of specific action hooks
    /// </summary>
    // CharMovementInformation
    CharMoveFromRoom,
    CharMoveToRoom,
    CharMove,
    CharEnterGame,
    CharLeaveGame,

    // CharRoomDirectionInformation
    CharLookDirection,
    CharPushDirection,
    CharOpenDirection,
    CharUnlockDirection,
    CharPickLockDirection,
    CharOtherActionDirection,

    // CharInventoryInformation
    CharViewInventory,
    CharViewEquip,
    CharEquipItem,
    CharUnequipItem,
    CharUseItem,

    // CharInventoryRoomInfo
    CharDropItem,
    CharPickupItem,
    CharLookRoomItem,
    CharUseRoomItem,

    // CharCharInformation
    CharCommunicateChar,
    CharEmoteChar,
    CharLookAtChar,
    CharLookAtPlayer,
    CharAttackChar,
    CharAttackPlayer,

    // CharCharObjectInformation
    CharGiveItem,
    CharReceiveItem,
    CharTradeItem,
    CharBuyItem,
    CharSellItem,

    // CharRoomInformation
    CharLookRoom,

    // MiscCharObjActionInformation
    CharCastSpell,
    CharUseSkill,

    // Each combat round (or HPCurrent? hmm...)
    // NYI
    CharCombatChar,
    CharCombatPlayer,

    // NYI
    RoomRepop,
    AreaRepop
  }

  public class ActionParameters
  {
    //public IEmlenMud EmlenMud;
    public ActionTypes actionType;
  }

  public class CharTypedCommand : ActionParameters
  {
    public string szIn = "";
    public CharacterData chr;
  }

  public class ModuleEventArgType : EventArgs
  {
    //public Modules.IEmlenMudModuleInterface moduleSendingMessage = null;
    public Type messageType;
    public Object moduleResponse = null;
  }
}
